/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package eventxmlparser;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;

/**
 *
 * @author krist_000
 */

@Root(name = "dayTime")
public class DayTime {
    
    public enum DayOfWeek {
        monday,
        tuesday,
        wednesday,
        thursday,
        friday,
        saturday,
        sunday
    }
    
    @Element
    private DayOfWeek day;
   
    @Element
    private String startTime;
    
    @Element
    private String endTime;

    public DayOfWeek getDay() {
        return day;
    }

    public void setDay(DayOfWeek day) {
        this.day = day;
    }
    
    public TimeOfDay GetStartTime() {
        return new TimeOfDay(startTime);
    }
    
    public TimeOfDay getEndTime() {
        return new TimeOfDay(endTime);
    }
    
    public class TimeOfDay {
        
        public TimeOfDay(String str) {
            hour = Integer.parseInt(str.substring(0, 2));
            minute = Integer.parseInt(str.substring(3, 5));
        }
        
        public int hour;
        public int minute;

        public int getHour() {
            return hour;
        }

        public void setHour(int hour) {
            this.hour = hour;
        }

        public int getMinute() {
            return minute;
        }

        public void setMinute(int minute) {
            this.minute = minute;
        }
        
        
        
        
    }
    
    
}
